<div class="body-cont"> 
<div class="form">
<?php if ( Yii::app()->getModule('job')->getTestIdBidjob($job) == true ): ?>
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'bidjob-form',
	'enableAjaxValidation'=>false,
)); 
	$jobtime = $model->job->statustime;
	if ($jobtime == 0) {
		$dayjob =7;
	}elseif ($jobtime == 1) {
		$dayjob = 30;
	}elseif ($dayjob == 2) {
		$dayjob = 90;
	}
?>

	<p class="note"><h2><?php echo $job->name; ?></h2></p>
    <b><?php echo 'Khỏang tài chính:'.$job->budget->minmoney.' '.$job->budget->currency->currency;?></b>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'money'); ?>
		<?php echo $form->textField($model,'money',array('size'=>5)).' '.$job->budget->currency->currency; ?>
		<?php echo $form->error($model,'money'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'timeduration'); ?>
		<?php echo $form->textField($model,'timeduration',array('size'=>5,'maxlength'=>100)); ?>
		<div class="errorMessage" id="errorTime" style="display:none;">Bạn nhập quá thời gian của dự án này</div>
		<?php echo $form->error($model,'timeduration'); ?>
	</div>
<script type="text/javascript">
	$("#BidJobCreate_timeduration").keyup(function(){
		var day = <?php echo $dayjob; ?>;
    	if ($('#BidJobCreate_timeduration').val()> day) {
    		$('#submitButton').attr("disabled", "disabled");
    		$('#errorTime').show();
    	}else{
    		$('#submitButton').removeAttr('disabled');
    		$('#errorTime').hide();
    	};
  });
</script>
	<div class="row">
		<?php echo $form->labelEx($model,'checkPoint'); ?>
		<?php echo $form->textField($model,'checkPoint',array('size'=>2,'maxlength'=>100)).'%'; ?>
		<?php echo $form->error($model,'checkPoint'); ?>
	</div>
    
     <div class="row">
        <?php echo $form->labelEx($model,'desc'); ?>
        <?php echo $form->textField($model,'desc',array('size'=>30)); ?>
        <?php echo $form->error($model,'desc'); ?>
    </div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array('disabled'=>false,'id'=>"submitButton")); ?>
	</div>

<?php $this->endWidget(); ?>
<?php else: ?>
    <h1>Bạn đã đăng ký làm dự án rồi. Vui lòng quay trở lại.</h1>
<?php endif; ?>
</div><!-- form -->
</div>